#include <iostream>

using namespace std;

int main()
{
	char s1[10000], s2[10000];
	char ch;
	int l1 = 0;
	int l2 = 0;
	scanf("%c", &ch); //Считывание
	while (ch != '\n')
	{
		s1[l1] = ch;
		l1++;
		scanf("%c", &ch);
	}
	scanf("%c", &ch);
	while (ch != '\n')
	{
		s2[l2] = ch;
		l2++;
		scanf("%c", &ch);
	}
	int a[10001], b[10001], c[10001];
	for (int i = l1 - 1; i >= 0; i--) //Преобразование в число
	{
		if (s1[i] == '1' ) a[l1 - i] = 1;
		if (s1[i] == '0' ) a[l1 - i] = 0;
		if (s1[i] == '$' ) a[l1 - i] = -1;
	}
	a[l1+1] = 0;
	for (int i = l2 - 1; i >= 0; i--) 
	{
		if (s2[i] == '1' ) b[l2 - i] = 1;
		if (s2[i] == '0' ) b[l2 - i] = 0;
		if (s2[i] == '$' ) b[l2 - i] = -1;
	}
	b[l2+1] = 0;
	c[max(l1, l2)] = 0;
	c[max(l1, l2)+1] = 0;
	c[max(l1, l2)+2] = 0;
	int p = 0;
	for (int i = 1; i <= max(l1, l2) + 1; i++) //сложение
	{
		c[i] = (a[i] + b[i] + p);
		p = 0;
		if (c[i] > 1) 
		{
			c[i] = c[i] - 3;
			p = 1;
			continue;
		}
		if (c[i] < -1) 
		{
			c[i] = c[i] + 3;
			p = -1;
		}
	}
	bool f = true;
	for (int i = max(l1, l2) + 2; i > 0; i--) //вывод
	{
		if (f && (c[i] != 0)) f = false;
		if (!f) 
		{
			if (c[i] == 0) printf("0");
			if (c[i] == 1) printf("1");
			if (c[i] == -1) printf("$"); 
		}
	}
	if (f) printf("0");
}